/*
 * @Author: 码上talk|RC
 * @Date: 2020-06-13 10:00:35
 * @LastEditTime: 2020-11-11 15:39:33
 * @LastEditors: 码上talk|RC
 * @Description: 
 * @FilePath: /tacomall-merchant/src/model/goods/index.js
 * @Just do what I think it is right
 */
import { Item } from './item'
export class Goods {
    constructor(goods = {
        goodsItem: []
    }) {
        const { id, name, attrJson, goodsItem } = goods
        this.id = id
        this.name = name
        this.cover = '//img10.360buyimg.com/n1/s450x450_jfs/t1/134887/24/15636/112103/5faa2eb9Eb1fe99ef/2ff0882c9607e57c.jpg'
        this.attrJson = attrJson ? JSON.parse(attrJson) : []
        this.items = goodsItem.map(i => new Item(i))
    }
}